import { getToken, setUserToken } from '@/utils/auth'
import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useUserStore = defineStore('hm-user', () => {
  const token = ref(getToken() || '')
  const setToken = (newToken:string)=>{
    token.value = newToken
    setUserToken(newToken)
  }
  return { token,setToken }
})
